<template>
  <div class="app-container">
    <el-card>
      <el-button :type="tab==='interview2.index.waiting-interview' ? 'primary' : ''" round @click="goRouter(1)">待面试</el-button>
      <el-button :type="tab==='interview2.index.first-interview' ? 'primary' : ''" round @click="goRouter(2)">一面管理</el-button>
      <el-button :type="tab==='interview2.index.waiting-second' ? 'primary' : ''" round @click="goRouter(3)">待二面</el-button>
      <el-button :type="tab==='interview2.index.second-interview' ? 'primary' : ''" round @click="goRouter(4)">二面管理</el-button>
      <el-button :type="tab==='interview2.index.waiting-hr' ? 'primary' : ''" round @click="goRouter(5)">待HR终面</el-button>
      <el-button :type="tab==='interview2.index.hr-interview-status-a' ? 'primary' : ''" round @click="goRouter(6)">谈薪状态</el-button>
      <el-button :type="tab==='interview2.index.hr-interview-status-b' ? 'primary' : ''" round @click="goRouter(7)">体检状态</el-button>
      <el-button :type="tab==='interview2.index.hr-interview-status-c' ? 'primary' : ''" round @click="goRouter(8)">OFFER状态</el-button>
      <el-button :type="tab==='interview2.index.hr-interview-success' ? 'primary' : ''" round @click="goRouter(9)">已录用</el-button>
    </el-card>
    <div style="margin-top: 20px">
      <router-view/>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Index',
  data() {
    return {
      tab: undefined
    }
  },
  created() {
    this.tab = this.$route.name
  },
  methods: {
    goRouter(n) {
      switch (n) {
        case 1:
          this.$router.push({
            name: 'interview2.index.waiting-interview'
          })
          break
        case 2:
          this.$router.push({
            name: 'interview2.index.first-interview'
          })
          break
        case 3:
          this.$router.push({
            name: 'interview2.index.waiting-second'
          })
          break
        case 4:
          this.$router.push({
            name: 'interview2.index.second-interview'
          })
          break
        case 5:
          this.$router.push({
            name: 'interview2.index.waiting-hr'
          })
          break
        case 6:
          this.$router.push({
            name: 'interview2.index.hr-interview-status-a'
          })
          break
        case 7:
          this.$router.push({
            name: 'interview2.index.hr-interview-status-b'
          })
          break
        case 8:
          this.$router.push({
            name: 'interview2.index.hr-interview-status-c'
          })
          break
        case 9:
          this.$router.push({
            name: 'interview2.index.hr-interview-success'
          })
          break
      }
    }
  }
}
</script>

<style scoped>

</style>
